package net.zjitc.service.impl;

import net.zjitc.dao.CategoryDao;
import net.zjitc.dao.impl.CategoryIDaompl;
import net.zjitc.domain.Category;
import net.zjitc.service.CategoryService;

import java.sql.SQLException;
import java.util.List;

/**
 * 2 * @Author: 洪瑶
 * 3 * @Date: 2018/10/29 18:34
 * 4
 */
public class CategoryServiceImpl implements CategoryService{
    CategoryDao dao = new CategoryIDaompl();

    @Override
    public List<Category> findAll() throws SQLException {
        return dao.sqlfindAll();
    }

    @Override
    public Category findBy(int id) throws SQLException {
        return dao.sqlfindBy(id);
    }

    @Override
    public boolean update(Category category, String id) throws SQLException {
        return dao.sqlupdate(category,id);
    }

    @Override
    public void delete(int id) throws SQLException {
        dao.sqldelete(id);
    }

}
